package com.wfy.common.util;

import org.slf4j.LoggerFactory;

/**
 * 说明：日志处理
 */
public final class Logger {

    private org.slf4j.Logger logger;

    private Logger() {
    }

    /**
     * 构造方法，初始化Log4j的日志对象
     */
    private Logger(org.slf4j.Logger logger) {
        this.logger = logger;
    }

    public static Logger getLogger(Class clazz) {
        return new Logger(LoggerFactory.getLogger(clazz));
    }

    public static Logger getLogger(String loggerName) {
        return new Logger(LoggerFactory.getLogger(loggerName));
    }

    public void debug(String msg) {
        logger.debug(msg);
    }

    public void debug(String msg, Throwable e) {
        logger.debug(msg, e);
    }

    public void info(String msg) {
        logger.info(msg);
    }

    public void info(String msg, Throwable e) {
        logger.info(msg, e);
    }

    public void warn(String msg) {
        logger.warn(msg);
    }

    public void warn(String msg, Throwable e) {
        logger.warn(msg, e);
    }

    public void error(String msg) {
        logger.error(msg);
    }

    public void error(String msg, Throwable e) {
        logger.error(msg, e);
    }

    public String getName() {
        return logger.getName();
    }

    public org.slf4j.Logger getLog4jLOGGER() {
        return logger;
    }
}